package com.cipe.cmrs.controllers;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.cipe.cmrs.service.ActionableAlertService;
import com.cipe.cmrs.service.ChnageNotificationService;

/**
 * 
 * @author krishna 
 * 			This class server as controller for this requriments
 *         Actionable Alerts and Change Notifications section - We are missing
 *         two links...1) To the right of "Actionable Alerts", there should be a
 *         link called "List of Actionable Alerts", which shows a list and
 *         description of the actionable Alerts section (see alldone-016.pdf) 2)
 *         To the right of the "Change Notifications" there should be a link
 *         called "List of Change Notification Types which shows a list and
 *         description of change notification types
 * 
 */
@Controller
public class MessageController extends BaseController {

	private static final long serialVersionUID = 1L;
	@Autowired
	ActionableAlertService alertService;
	@Autowired
	ChnageNotificationService notificationService;

	@RequestMapping("/secure/actionalertMessage.do")
	public String actionalertMessage(Model model, HttpServletRequest request) {
		model.addAttribute("actionableAkertList",
				alertService.getAllActionableAlert());
		return "actionalertMessage";
	}

	@RequestMapping("/secure/changeNotificationMessage.do")
	public String changeNotificationMessage(Model model,
			HttpServletRequest request) {
		model.addAttribute("changeNotificationList",
				notificationService.getAllChangeNotification());
		return "ChangeNotificationMessage";
	}

}
